const path = require('path');

function resolve(dir) {
	return path.join(__dirname, dir)
}
module.exports = {
	runtimeCompiler: true,
	publicPath: '/mobile',
	devServer: {
		host: '0.0.0.0',
		port: 9527,
		disableHostCheck: true,
		proxy: {
			'/dev': {
				target: 'https://onlineshare.bjcapitalland.com.cn',
				ws: true,
				changeOrigin: true,
				pathRewrite: {
					"^/dev": "/sd"
				}
			}
		}
	},
	configureWebpack: {
		plugins: [
		],
		//不通过npm下载的类库，在html文件中以script引入，然后在页面中使用import导入的这种方式
		externals: {
			// 'google': 'google',
			// 'paypal': 'paypal'
		},
		// provide the app's title in webpack's name field, so that
		// it can be accessed in index.html to inject the correct title.
		resolve: {
			alias: {
				'@': resolve('src'),
			},
		},
	},
	// 配置scss全局变量
	css: {
		loaderOptions: {
			scss: {
				prependData: `@import "@/style/theme/main.scss";`
			}
		}
	},
	// 打包时不生成.map文件 避免看到源码
	productionSourceMap: false
}